package com.j4dream.property.dao;

import com.j4dream.property.model.PermissionDto;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PermissionDao {

    @Insert("INSERT INTO permission (name, description) VALUES (#{name}, #{description})")
    @Options(useGeneratedKeys = true, keyColumn = "get")
    void insertPermission(PermissionDto permission);

    @Select("SELECT * FROM permission")
    List<PermissionDto> getPermList();

}
